package com.atguigu.javaailangchain4j.agent;

import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.service.spring.AiService;
import reactor.core.publisher.Flux;

import static dev.langchain4j.service.spring.AiServiceWiringMode.EXPLICIT;

@AiService(
        wiringMode = EXPLICIT,
        chatModel = "qwenChatModel",
        chatMemoryProvider = "chatMemoryProvider",
//        tools = "calculatorTools" //配置function coll 加法 平方跟
        tools = "appointmentTools", //配置function coll
        contentRetriever = "contentRetrieverPincone" ,//配置向量存储
        streamingChatModel = "qwenStreamingChatModel"
)
public interface SeparateChatAssistant {
    /**
     * 分离聊天记录
     *
     * @param memoryId    聊天id
     * @param userMessage 用户消息
     * @return
     */
    @SystemMessage(fromResource = "system.txt")
    String chat(@MemoryId int memoryId, @UserMessage String userMessage);

    @SystemMessage(fromResource = "system.txt")
    Flux<String> chat1(@MemoryId int memoryId, @UserMessage String userMessage);
}